//
//  HTriangleView.m
//  HMusicPlayer
//
//  Created by Hament on 14/9/18.
//  Copyright (c) 2014年 HJ. All rights reserved.
//

#import "HTriangleView.h"
#import "HCoreConfig.h"
#import "HskinManager.h"


@implementation HTriangleView

- (void)drawRect:(NSRect)dirtyRect {
    [super drawRect:dirtyRect];
    
    // Drawing code here.
    //sin(60);
    float sin60=cos(M_PI_2/3);
    CGFloat widthX=dirtyRect.size.width*sin60;
    CGFloat widthY=dirtyRect.size.height/2;
    
    NSBezierPath *triangle = [[NSBezierPath alloc] init];
    [triangle moveToPoint:NSMakePoint(0,0)];//左下
    [triangle lineToPoint:NSMakePoint(widthX, widthY)];//右
    [triangle lineToPoint:NSMakePoint( 0, dirtyRect.size.height)];
    [triangle closePath];
    [[HCoreConfig shareConfig].currentSkinManager.sliderHighlightColor setFill];//和slider hightlight color
    [triangle fill];
//    [[NSColor darkGrayColor] set];
//    [triangle stroke];
    
}



-(void)refreshBGcolorWithColor{

    [self setNeedsDisplay:YES];
    
}


-(NSInteger)tag{

    return playTringleViewTag;

}

@end
